using FixMath;

namespace UniFramework.Battle
{
	public class LogicFrameConfig
	{
		/// <summary>
		/// 逻辑帧间隔时间
		/// </summary>
		public static float logicFrameInterval = 0.066f;

		/// <summary>
		/// 毫秒级别的逻辑帧间隔
		/// </summary>
		public static int logicFrameIntervalMs = 66;

		/// <summary>
		/// 定点数逻辑帧间隔时间
		/// </summary>
		public static FixInt logicFrameIntervalFixInt = new FixInt(0.066f);


		/// <summary>
		/// 时间转换为帧
		/// </summary>
		/// <param name="frameCnt"></param>
		/// <returns></returns>
		public static float GetRealTime(int frameCnt)
		{
			return frameCnt * logicFrameInterval;
		}

		/// <summary>
		/// 帧转换为时间
		/// </summary>
		/// <param name="time"></param>
		/// <returns></returns>
		public static int GetFrameCnt(float time)
		{
			return (int)(time / logicFrameInterval);
		}
	}
}